﻿<UserControl x:Class="TeamBuildScreen.Core.Views.BuildGrid"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:b="clr-namespace:TeamBuildScreen.Core.Views">
	<Grid>
		<Grid.Background>
			<RadialGradientBrush>
				<GradientStop Color="#FF999999" Offset="0.2" />
				<GradientStop Color="#FF333333" Offset="1.0" />
			</RadialGradientBrush>
		</Grid.Background>
		<ItemsControl ItemsSource="{Binding Builds}">
			<ItemsControl.ItemTemplate>
				<DataTemplate>
					<b:BuildPanel Margin="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type UserControl}}, Path=DataContext.InnerMargin}" DataContext="{Binding}"></b:BuildPanel>
				</DataTemplate>
			</ItemsControl.ItemTemplate>
			<ItemsControl.ItemsPanel>
				<ItemsPanelTemplate>
					<UniformGrid Columns="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type UserControl}}, Path=DataContext.Columns}" VerticalAlignment="Stretch"/>
				</ItemsPanelTemplate>
			</ItemsControl.ItemsPanel>
		</ItemsControl>
		<b:MessagePanel DataContext="{Binding ErrorMessageViewModel}"></b:MessagePanel>
		<Button Command="{Binding RequestClose}" Opacity="0"/>
	</Grid>
</UserControl>
